﻿function koAdvRecentPostsScrollerv3(json) {
	var korecentposts;
	var kopostlink;
	var koobj;
	var komarqueehtml;
	var komarqueehtml2;
	var byblogtariff;
	var kolinkgap;
	var koposttargetlink;
	var koBullet;
	try {
		komarqueehtml = "\<marquee behavior=\"scroll\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\" ";

		if (koScrollAmount) {
			komarqueehtml = komarqueehtml + " scrollamount = \"" + koScrollAmount + "%\"";
		} 
		if (koWidth) {
			komarqueehtml = komarqueehtml + " width = \"" + koWidth + "%\"";
		} else {
			komarqueehtml = komarqueehtml + " width = \"100%\"";
		}
		if (koScrollDelay) {
			komarqueehtml = komarqueehtml + " scrolldelay = \"" + koScrollDelay + "\"";
		}
		if (koDirection) {
			komarqueehtml = komarqueehtml + " direction = \"" + koDirection + "\"\>";
			if (koDirection == "left" || koDirection == "right") {
				kolinkgap = "&nbsp;&nbsp;&nbsp;";
			} else {
				kolinkgap = "\<br/\>";
			}
		}
		if (kotargetlink == "yes") {
			koposttargetlink = " target= \"_blank\" ";
		} else {
			koposttargetlink = " ";
		}
		if (koimagebullet == "yes") {
			koBullet = " \<img class=\"kobulletbimg\" src=\"" + koimgurl + "\" />";
		} else {
			koBullet = koBulletchar;
		}
		komarqueehtml2 = "\</marquee\>"
		korecentposts = "";
		for (var korp = 0; korp < konumPosts; korp++) {
			var koobj = json.feed.entry[korp];
			if (korp == json.feed.entry.length) break;
			for (var kocc = 0; kocc < koobj.link.length; kocc++) {
				if (koobj.link[kocc].rel == 'alternate') {
					kopostlink = koobj.link[kocc].href;
					break;
				}
			}
			korecentposts = korecentposts + koBullet + " \<a " + koposttargetlink + " href=\"" + kopostlink + "\">" + koobj.title.$t + "\</a\>" + kolinkgap;
		}
		
		if (koDirection == "left") {
			korecentposts = korecentposts + "&nbsp;&nbsp;&nbsp;" + byblogtariff;
		} else if (koDirection == "right") {
			korecentposts = byblogtariff + "&nbsp;&nbsp;&nbsp;" + korecentposts;
		} else if (koDirection == "up") {
			korecentposts = korecentposts + "\<br/\>" + byblogtariff;
		} else {
			korecentposts = byblogtariff + "\<br/\>" + korecentposts;
		}
		document.write("\<style style=\"text/css\"\>.blogtariff-srp{font-size:" + kofontsize + "px;background:#" + kobgcolor + ";font-weight:bold;}.blogtariff-srp a{color:#" + kolinkcolor + ";text-decoration:none;}.blogtariff-srp a:hover{color:#" + kolinkhovercolor + ";}img.kobulletbimg{vertical-align:middle;border:none;}\</style\>")
		document.write("\<div class=\"blogtariff-srp\"\>" + komarqueehtml + korecentposts + komarqueehtml2 + "\</div\>")
	} catch (exception) {
		alert(exception);
	}
}